package com.yuliang.basic;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

public class User implements InitializingBean, DisposableBean {

    private Integer id;

    public User(){

    }
    public User(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    private String name;

    private String[] emails;
    private List<String> list;
    private Set<String> tels;
    private Map<String,String> map;
    private Properties properties;

    public String[] getEmails() {
        return emails;
    }

    public void setEmails(String[] emails) {
        this.emails = emails;
    }

    public List<String> getList() {
        return list;
    }

    public void setList(List<String> list) {
        this.list = list;
    }

    public Set<String> getTels() {
        return tels;
    }

    public void setTels(Set<String> tels) {
        this.tels = tels;
    }

    public Map<String, String> getMap() {
        return map;
    }

    public void setMap(Map<String, String> map) {
        this.map = map;
    }

    public Properties getProperties() {
        return properties;
    }

    public void setProperties(Properties properties) {
        this.properties = properties;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }

    public void afterPropertiesSet() throws Exception {
        System.out.println("i am created");
    }
    public void myInit(){
        System.out.println("hello !");
    }

    public void destroy() throws Exception {
        System.out.println("i am go");
    }

    public void myDisposal(){
        System.out.println("bye bye");
    }
}
